Q: I'm writing an application which can open either EPS or TIFF images using the NXImage class. How can I determine what kind of file I've opened without hacking the file name?\
if ([myImageRep isKindOf: [NXBitmapImageRep class]])\
\{\
/* then I'm a TIFF file! */\
\}\
else if ([myImageRep isKindOf: [NXEPSImageRep class]])\
\{\
/* then I'm an EPS file! */\
\}\
\f0\fs28 \
The key here is that the NXImage instance itself does not understand EPS or TIFF information per se. NXImage manages the
\i representation
\i0 classes [one NXImage may have multiple representations] which do understand EPS and TIFF information.\
\
Of course, it is reasonable to extract this information from the fileName as well. The following code snippet can be used to do this: [This approach will work under 1.0 as well as 2.0.]\